### 2. Instrument your application
**For Kubernetes deployments with zero-code instrumentation:**

```yaml
apiVersion: openlit.io/v1alpha1
kind: AutoInstrumentation
metadata:
  name: middleware-instrumentation
  namespace: default
spec:
  selector:
    matchLabels:
      instrument: "true"
  python:
    instrumentation:
      provider: "openlit"
      version: "latest"
  otlp:
    endpoint: "MW_TARGET"
    headers: "Authorization=MW_API_KEY,X-Trace-Source=openlit"
    timeout: 30
  resource:
    environment: "production"
    serviceName: "my-ai-service"
```

Replace:
1. `MW_TARGET` with your Middleware target URL from Step 1.
   * Example: `https://abcd.middleware.io:443`
2. `MW_API_KEY` with your Middleware API key from Step 1.
   * Example: `dxyxsdojzrgpsvizzzcsvhrwnmzqdsdsd`

Refer to the [OpenLIT Operator Documentation](/latest/operator/overview) for more advanced configurations and use cases.
